package com.education.ai.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.context.annotation.Bean;

/**
 * 通义万象API配置类
 */
@Configuration
public class TongYiVisionConfig {
    
    @Value("${tongyi.vision.api.key:your-api-key-here}")
    private String apiKey;
    
    @Value("${tongyi.vision.api.endpoint:https://dashscope.aliyuncs.com/api/v1}")
    private String apiEndpoint;
    
    @Bean
    public WebClient tongYiVisionWebClient() {
        return WebClient.builder()
                .baseUrl(apiEndpoint)
                .defaultHeader("Authorization", "Bearer " + apiKey)
                .defaultHeader("Content-Type", "application/json")
                .build();
    }
} 